<div class="row"> <h3 class="page-header">课程实验计划审核调整</h3></div>
<div class="row">
    <div class="panel panel-default">
        <div class="panel-body">
          <form action='{:U("Jxsygl/kcsyjh")}' class="form-inline text-right fr m-b-5">
                老师名称：<input type="kcsyjh" name='teacher' value='{$Think.get.teacher}' class="form-control mr20 w150" >
                <button class="btn btn-primary" type="submit">搜索</button>
            </form>
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover">
                    <thead>
                    <tr>
                        <th width="60">序号</th>
                        <th>实验课程</th>
                        <th>申请的班级</th>
                        <th>教师名称</th>
                        <th>节次</th>
                        <th>使用日期</th>
                        <th width="160">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                        <empty name="list">
                            <tr><td colspan="6" align="center">暂无信息</td></tr>
                        </empty>
                        <volist name="list" id="list">
                            <tr>
                                <td>{$i}</td>
                                <td>{$list.sy_course}</td>
                                <td>{$list.class}</td>
                                <td>{$list.teacher}</td>
                                <td>第{$list.jc}节课</td>    
                                <td>{$list.syrq|date='Y-m-d',###}</td> 
                                <td> 
                                <eq name="Think.session.adminInfo.gid" value="2">
                                   <a class=" btn btn-default btn-sm editText" data-id='{$list.id}'>审核</a>
                                </eq>
                                <a class="btn-sm btn btn-default" href='{:U("Jxsygl/kcsyjhselect?id=".$list["id"])}'>浏览</a>            
                             </tr>
                         </volist>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div id="myModal" class="modal fade in" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content">
            <form action="{:U('Jxsygl/kcsyjhsh')}" id="myform" class="form-horizontal" data-callback="_form_defult_callback">
                <div class="modal-header">
                    <button data-dismiss="modal" class="close" type="button">×</button>
                    <h4 class="modal-title">课程实验计划审核</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">实验课程：<span class="c-red">*</span></label>
                        <div class="col-sm-6 input-group">
                            <input class="form-control required" name="sy_course">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">申请的班级：</label>
                        <div class="col-sm-6 input-group">
                            <input class="form-control required" name="class">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">节次：</label>
                            <div class="col-sm-6 input-group">
                                <select class="form-control" name="jc">
                                    <option value="1" data-id="{:C('jd1_s')},{:C('jd1_e')}">第一节课</option>
                                    <option value="2" data-id="{:C('jd1_s')},{:C('jd1_e')}">第二节课</option>
                                    <option value="3" data-id="{:C('jd1_s')},{:C('jd1_e')}">第三节课</option>
                                    <option value="4" data-id="{:C('jd1_s')},{:C('jd1_e')}">第四节课</option>
                                    <option value="5" data-id="{:C('jd1_s')},{:C('jd1_e')}">第五节课</option> 
                                    <option value="6" data-id="{:C('jd1_s')},{:C('jd1_e')}">第六节课</option>
                                    <option value="7" data-id="{:C('jd1_s')},{:C('jd1_e')}">第七节课</option>
                                    <option value="8" data-id="{:C('jd1_s')},{:C('jd1_e')}">第八节课</option>
                                    <option value="9" data-id="{:C('jd1_s')},{:C('jd1_e')}">第九节课</option>
                                    <option value="10" data-id="{:C('jd1_s')},{:C('jd1_e')}">第十节课</option>
                                    <option value="11" data-id="{:C('jd1_s')},{:C('jd1_e')}">第十一节课</option>
                                    <option value="12" data-id="{:C('jd1_s')},{:C('jd1_e')}">第十二节课</option>
                                </select>
                            </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">教师名称：</label>
                            <div class="col-sm-6 input-group">
                                <input class="form-control required" name="teacher">
                            </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-3 control-label">审核状态：</label>
                            <div class="col-sm-2 input-group">
                                <select class="form-control" name="status">
                                    <option value="1">同意</option>
                                    <option value="0">驳回</option>
                                </select>
                            </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">输入意见：</label>
                            <div class="col-sm-6 input-group" >
                                <textarea style="width: 100%;resize: vertical;" name="sh_yj" class="form-control required"></textarea>
                            </div>
                    </div>
                <div class="modal-footer">
                    <button class="btn btn-primary" type="submit">保存</button>
                    <button data-dismiss="modal" class=" btn btn-default" type="button">关闭</button>
                </div>
               <input type='hidden' name='id' value='{$info.id}'>
            </form>
        </div>
    </div>
</div>
<script>
    $(function(){
        $('.editText').click(function(){
            $('#myform')[0].reset();
            var id = $(this).data('id'); waiting();
            $.get('{:U("Jxsygl/kcsyjhsh")}', {id: id}, function(data){
                complete();
                if(data.status == 1){
                    var _get_info = data.info;
                    $('#myform input[name="id"]').val(_get_info.id);
                    $('#myform input[name="sy_course"]').val(_get_info.sy_course);
                    $('#myform input[name="class"]').val(_get_info.class); 
                    $('#myform input[name="teacher"]').val(_get_info.teacher); 
                    $('#myform select[name="jc"]').val(_get_info.jc); 
                    $('#myform select[name="status"]').val(_get_info.status); 
                    $('#myform textarea[name="sh_yj"]').val(_get_info.sh_yj); 
                    $('#myform').attr('action', '{:U("Jxsygl/kcsyjhsh")}');
                    $('#myModal').modal('show');
                }else{
                    showInfo(data.info);
                    setTimeout('_form_defult_callback()', 1600);

                }
            });
        })
    });

</script>